//
//  PayManager.h
//  PigMarket
//
//  Created by mac on 2019/5/17.
//  Copyright © 2019 felix.pigmarket.oc. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <WXApi.h>


typedef NS_ENUM(NSInteger, PayErrCode) {
    PayErrCodeSuccess,// 成功
    PayErrCodeFailure,// 失败
    PayErrCodeCancel// 取消
};
typedef void(^PayCompleteCallBack)(PayErrCode errCode,NSString *errStr);
@interface PayManager : NSObject
/**
 单例
 */
+ (instancetype)sharedManager;

/**
 微信注册
 */
- (void)wxPayRegister;

/**
 处理跳转url，回到应用，需在delagate中处理
 @param url url
 */
- (BOOL)handelPayURL:(NSURL *)url;

/**
 微信支付

 @param model 入参

 */
- (void)payWithWeChatMethod:(Pay *)model callBack:(PayCompleteCallBack)callBack;

/**
 支付宝支付
 @param payOrder 下发数据
 */
- (void)payWithAlipayMethod:(NSString *)payOrder callBack:(PayCompleteCallBack)callBack;


@end

